/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.helpergenerators;

import pl.edu.amu.wmi.kino.visualjavafx.model.animation.transformations.Fillable;

/**
 *
 * @author Admin
 */
public class FillGenerator {
    public static String fill="FillParam";

    public static void generateFillVar(StringBuilder sb, Fillable o,int recursionLevel) {
        String rName=ColorVarsNameGenerator.getR(fill, recursionLevel);
        String gName=ColorVarsNameGenerator.getG(fill, recursionLevel);
        String bName=ColorVarsNameGenerator.getB(fill, recursionLevel);
        sb.append("var "+rName+"="+o.getFillColor().getRed()+";\n");
        sb.append("var "+gName+"="+o.getFillColor().getGreen()+";\n");
        sb.append("var "+bName+"="+o.getFillColor().getBlue()+";\n");
    }

    public static void generateFillAttribute(StringBuilder sb,int recursionLevel) {
        String rName=ColorVarsNameGenerator.getR(fill, recursionLevel);
        String gName=ColorVarsNameGenerator.getG(fill, recursionLevel);
        String bName=ColorVarsNameGenerator.getB(fill, recursionLevel);
        sb.append("override attribute fill=bind Color.rgb("+
                rName+","+gName+","+bName+","+");\n");
    }


}
